#include "student.h"
#include <iostream>

Student::Student() {}
Student::Student(const std::string& id, const std::string& name) : id(id), name(name) {}

void Student::input(bool debug, int index) {
    if (debug) {
        char buf[16];
        snprintf(buf, sizeof(buf), "E2022%03d", index+1);
        id = buf;
        name = "学生" + std::to_string(index+1);
    } else {
        std::cout << "请输入学号：";
        std::cin >> id;
        std::cout << "请输入姓名：";
        std::cin >> name;
    }
}
